package com.bw.paper.mvp.view.news.adapter;

import com.bw.paper.mvp.model.entity.ChannelEntity;

import java.util.List;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

public class NewsVpAdapter extends FragmentPagerAdapter {
    private List<ChannelEntity.Values> list;
    private List<Fragment>fragments;
    public NewsVpAdapter(@NonNull FragmentManager fm,List<Fragment>fragments,List<ChannelEntity.Values> list) {
        super(fm);
        this.fragments = fragments;
        this.list = list;
    }

    @NonNull
    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }

    @Override
    public int getCount() {
        return fragments.size();
    }

    @Nullable
    @Override
    public CharSequence getPageTitle(int position) {
        return ""+list.get(position).channel_name;
    }
}
